package cn.tedu.charging.user.controller;

import cn.tedu.charging.common.pojo.JsonResult;
import cn.tedu.charging.user.pojo.vo.UserInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping("/user")
@RestController
@Api(tags = "用户接口")
public class UserController {


    /**
     * 通过用户id获取车辆信息
     * @param userId
     * @return JsonResult
     */
    @ApiOperation("获取用户信息")
    @GetMapping("/info/{userId}")
    public JsonResult getUserInfo(@PathVariable("userId") Integer userId){
        log.debug("获取用户信息-{}",userId);
        UserInfoVO userInfoVO = new UserInfoVO();
        userInfoVO.setCarId(11);
        JsonResult jsonResult = new JsonResult();
        jsonResult.setData(userInfoVO);
        jsonResult.setCode(2000);
        return jsonResult;
    }
}
